function showMsg(title, message, timeout){
	var notification = webkitNotifications.createNotification(
		'icon.png',
		title,
		message
	);
	notification.show();
	if(!timeout)
		timeout = msgTimeout;
	if(timeout > 0){
		setTimeout(function(){
			notification.cancel();
		}, timeout);
	}
	return notification;
}

function getLastError(){
	if(localStorage["lasterrormsg"]){
		return {
			"msg" : localStorage["lasterrormsg"],
			"log" : localStorage["lasterrorlog"]
		}
	} else {
		return null;
	}
}

function setLastError(msg, log){
	localStorage["lasterrormsg"] = msg;
	localStorage["lasterrorlog"] = log;
}

function clearLastError(){
	localStorage.removeItem("lasterrormsg");
	localStorage.removeItem("lasterrorlog");
}